package cn.ainit.sys.framework.save;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import cn.ainit.common.ReturnObject;
import cn.ainit.sys.framework.entity.SysColumns;
import cn.ainit.sys.query.datastore.DataStore;


@Service
public class CommonSaveServiceImpl implements CommonSaveService {
	
	private CommonSaveDao commonSaveDao;
	
	@Resource
	public void setCommonSaveDao(CommonSaveDao commonSaveDao) {
		this.commonSaveDao = commonSaveDao;
	}
	
	@Override
	public boolean testSave(String sql) throws Exception {
		return commonSaveDao.testSave(sql);
	}
	
	@Override
	public boolean saveObj(String sql, List<String> values)
			throws Exception {
		return commonSaveDao.saveObj(sql, values);
	}
	@Override
	public List<SysColumns> loadColumns(String dsId) throws Exception {
		return commonSaveDao.loadColumns(dsId);
	}
	
	@Override
	public DataStore loadDS(String dsId) throws Exception {
		return commonSaveDao.loadDS(dsId);
	}
	
	@Override
	public boolean updateObj(String sql, List<String> cValues,
			List<String> wValues) throws Exception {
		return commonSaveDao.updateObj(sql, cValues,wValues) ;
	}
	
	@Override
	public ReturnObject saveComm(String diu,String dsid, Map mapRecord,HttpSession session)
			throws Exception {
		return commonSaveDao.saveComm(diu,dsid, mapRecord,session);
	}

	@Override
	public ReturnObject saveCommDG(String djdsid, String fkid,String diu,String sinId,String dsid, Map mapRecord,
			HttpSession session) throws Exception {
		return commonSaveDao.saveCommDG(djdsid, fkid,diu,sinId,dsid, mapRecord,session);
	}

	@Override
	public ReturnObject saveCommU(ReceiveZM receiveZMobj, HttpSession session,HttpServletRequest request)
			throws Exception {
		return commonSaveDao.saveCommU(receiveZMobj,session,request);
	}
	
	@Override
	public ReturnObject saveCommL(ReceiveList receiveList, HttpSession session)
			throws Exception {
		return commonSaveDao.saveCommL(receiveList, session);
	}
	
	@Override
	public ReturnObject saveCommDGOTM(ReceiveOtM omObj, HttpSession session) throws Exception{
		return commonSaveDao.saveCommDGOTM(omObj,session);
	}

	
}
